package com.zy.server.controller;


import com.zy.dto.SmsCodeDto;
import com.zy.server.service.SmslogService;
import com.zy.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 张鑫
 * @since 2020-11-27
 */
@RestController
@RequestMapping("/api/smslog")
public class SmslogController {

    @Autowired
    private SmslogService smslogService;

    // 发送短信验证码
    @PostMapping("/sendcode.do")
    public R sendcode(String phone) {
        return smslogService.sendCode(phone);
    }

    // 验证验证码
    @PostMapping("/checkcode.do")
    public R checkcode(@RequestBody SmsCodeDto smsCodeDto) {
        return smslogService.checkCode(smsCodeDto);
    }

}
